------------- Bubble sort ------------- Sorts an array of values using quick sort; https://en.wikipedia.org/wiki/Bubble_sort function bubblesort(a) n=#a swapped=true while swapped do cls() swapped=false local last=0 for i=2,n do if a[i-1] > a[i] then swap(a,i,i-1) swapped=true end end n=n-1 end end